﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameName1
{
    abstract class Alien : GameObject, IHittable, IDisplayable, IMovable
    {
        protected int Points;

        protected Alien(Vector2 position) : base(position)
        {
        }

        public virtual void HandleHit(IHittable other, GameTime colissionTime)
        {
            GameObjectsManager.GetInstance().Destroy(this);

            if(other is Projectile)
                GameplayScene.Points += Points;
        }
        public virtual Rectangle GetCollisionBox()
        {
            return new Rectangle((int)Position.X, (int)Position.Y, Sprite.Width, Sprite.Height);
        }
        public virtual IEnumerable<Type> GetNotHittableTypes()
        {
            return new List<Type>{typeof(PowerUp), typeof(Missile)};
        }

        protected virtual Texture2D Sprite { get; set; }
        public int DrawingOrder { get { return 0; } }
        public abstract void Draw(SpriteBatch spriteBatch);

        public Vector2 Velocity { get; set; }
        public virtual void Move()
        {
            Position += Velocity;
        }
    }
}
